<?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'category-form',
        'enableAjaxValidation' => false,
        'enableClientValidation' => true,
        'htmlOptions' => array(
            'class' => 'form-horizontal',
             'enctype' => 'multipart/form-data'
        ),
    ));
?>
<div class="row-fluid">
    <div class="span12">
        <!--PAGE CONTENT BEGINS-->
                <div class="control-group">
                    <label class="control-label"> Language</label>
                    <div class="controls">
                        <?php foreach($language as $value) : ?>
                            <a class="btn btn-primary" href="<?php echo Yii::app()->createUrl('bookingsystem/event/update_lang', array(
                            'id' => $value['id'],
                            'event' => $model->id
                            )); ?>">
                                <?php echo $value['name']; ?>
                            </a>
                        <?php endforeach;?>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'event_code', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo $form->textField($model, 'event_code', array('size' => 60, 'maxlength' => 255, 'class' => 'span5', 'placeholder' => 'Event code')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'event_code'); ?></span>
                    </div>
                </div>
                
                <div class="control-group">
                    <?php echo $form->labelex($model, 'contact', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo $form->textField($model, 'contact', array('size' => 60, 'maxlength' => 255, 'class' => 'span5', 'placeholder' => 'Contact')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'contact'); ?></span>
                    </div>
                </div>
            
                <div class="control-group">
                   <?php echo $form->labelex($model, 'start_date', array('class' => 'control-label')); ?>
                   <div class="controls">
                               <div class="row-fluid input-append">
                                        <?php echo $form->textField($model, 'start_date',array('data-date-format'=>'dd-mm-yyyy','class'=>'date-picker')); ?>
                                       <span class="add-on">
                                               <i class="icon-calendar"></i>
                                       </span>
                                   <span class="help-inline"><?php echo $form->error($model, 'expired_date'); ?></span>
                               </div>
                   </div>
               </div>       
        
                <div class="control-group">
                    <?php echo $form->labelex($model, 'start_time', array('class' => 'control-label')); ?>
                    <div class="controls">
                                    <div class="input-append bootstrap-timepicker">
                                            <?php echo $form->textField($model, 'start_time',array('class'=>'input-small timepicker1')); ?>
                                            <span class="add-on">
                                                    <i class="icon-time"></i>
                                            </span>
                                    </div>
                        <span class="help-inline"><?php echo $form->error($model, 'start_time'); ?></span>
                    </div>
                </div>
        

                <div class="control-group">
                    <?php echo $form->labelex($model, 'fileImage', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo $form->fileField($model, 'fileImage', array('class' => 'id-input-file-1 span5')); ?>
                        <span class="help-inline" style="float:left;margin-left:390px;"><?php echo $form->error($model, 'fileImage'); ?></span>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelex($model, 'video_link', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo $form->textField($model, 'video_link', array('size' => 60, 'maxlength' => 255, 'class' => 'span5', 'placeholder' => 'Video link')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'video_link'); ?></span>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelex($model, 'priority', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <?php echo $form->textField($model, 'priority', array('size' => 60, 'maxlength' => 255, 'class' => 'span5', 'placeholder' => 'Priority')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'priority'); ?></span>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'active_status', array('class' => 'control-label')); ?>
                    <div class="controls">
                         <?php echo $form->dropDownlist($model, 'active_status', array(0 => 'Inactive',1=> 'Active')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'active_status'); ?></span>
                    </div>
                </div>
<!--                <div class="control-group">
                    <?php echo $form->labelex($model, 'tag', array('class' => 'control-label')); ?>
                    <div class="controls">
                         <?php echo $form->textField($model, 'tag', array('data-role' => 'tagsinput', 'class' => 'span5','placeholder'=>'Add tag')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'tag'); ?></span>
                    </div>
                </div>-->

                <div class="control-group">
                    <?php echo $form->labelEx($model, 'category_id', array('class' => 'control-label')); ?>
                    <div class="controls">
                         <?php echo $form->dropDownlist($model, 'category_id', MyFunctionCustom::getDropdownlistCategoryEvent(),array('class' => 'span5', 'placeholder' => 'Language')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'category_id'); ?></span>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelex($model, 'gallery_id', array('class' => 'control-label')); ?>
                    <div class="controls">
                        <div  id="gallary-tmp" style="margin-bottom:10px;">
                            <?php if($model->gallery_id !=''): 
                                 $gallery = Item::model()->with('gallery')->findByAttributes(array('gallery_id'=>$model->gallery_id));
                                 if($gallery):
                            ?>
                            <img src="<?php echo Yii::app()->baseUrl; ?>/timthumb.php?src=<?php echo Yii::app()->baseUrl; ?>/data/image/event/<?php echo $gallery->name; ?>&h=150&w=150" />
                            <?php endif;endif; ?>
                        </div>
                         <?php echo $form->hiddenField($model,'gallery_id');?>
                         <?php echo $form->hiddenField($model,'tmpGallery');?>
                        <a href="#modal-form" role="button" class="blue" data-toggle="modal">
                           <button class="btn btn-small btn-primary">Choose Gallery</button>
                        </a>
                        <span class="help-inline"><?php echo $form->error($model, 'gallery_id'); ?></span>
                    </div>
                </div>
                
                <div class="form-actions">
                    <button class="btn btn-info" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        Submit
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="icon-undo bigger-110"></i>
                        Reset
                    </button>
                </div>
    </div>
</div>

 <?php $this->endWidget(); ?>
<script src="<?php echo Yii::app()->theme->baseUrl; ?>/backend/tag/bootstrap-tagsinput.js"></script>
<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/backend/tag/bootstrap-tagsinput.css">
<style>
    .control-group span.required,.errorMessage {color:red;}
    .bootstrap-tagsinput {width:365px;margin-top:5px;}
    .ace-file-input {width: 380px;height: auto;}

.div1, .div2, .div3{
        float: left;
    }
    .div1 select, .div2 select{
    margin-left: 20px;
    width: 50px;
    }
    
    .div2 label{
        width: 100px !important;
    }
    
    .div3 input{
        width: 200px !important;
    }
    
    .jason{
        display: none;
    }
    
    .add{
        clear: both;
        padding-top: 10px;
    }
    
    .div4 .controls a{
        height: 18px;
        vertical-align: middle;        
    }
    
    .div4 .btn{
        line-height: 0px;
    }    
</style>
<?php echo $this->renderPartial('_popup', array('model'=>$model,'data' => $data)); ?>
